#!/bin/bash
#输入文件路径
read -p "input a path：" path
if [ -L $path ] && [ -e $path ]&>/dev/null
then
#有效链接
    echo "this is effective link"
elif [ -L $path ] ! [ -e $path ]&>/dev/null
then
#无效链接
    echo "this is not effective link"
elif [ -d $path ]&>/dev/null
then
#目录
    echo "this is director"
elif [ -f $path ]&>/dev/null
then
#普通文件
    echo "this is file"
elif [ -e $path ]&>/dev/null
then
#文件存在
    echo "this is other type file"
elif [ -b $path ]&>/dev/null
then
#块设备文件
    echo "this is block device file"
elif [ -c $path ]&>/dev/null
then
#字符设备文件
    echo "this is character device file"
elif [ -s $path ]&>/dev/null
then
#套接字文件
    echo "this is socket file"
elif [ -p $path ]&>/dev/null
then
#管道文件
    echo "this is pipe file"
else
#文件不存在
    echo "the files is not exist"
fi